/**
 * Created by Administrator
 * 表单验证
 */
var Form = {};

    Form.verify = function(dom) {
        var res = {status:true, msg:''}
        $(dom).find('select,input,textarea').each(function (e, t) {
            var tagName = t.tagName;
            var required = $(t).data('required');
            if (tagName == 'SELECT') {
                $(t).parent().css("border","1px solid #dedfe3");
            }else{
                $(t).css("border","1px solid #dedfe3");
            }
            if (required == true) {
                var val = $(t).val();
                if(val == '') {
                    if (tagName == 'SELECT') {
                        $(t).parent().css("border","1px solid red");
                    }else{
                        $(t).css("border","1px solid red");
                        $(t).focus();
                    }
                    var reqtext = $(t).data('reqtext');
                    if (reqtext) {
                        res.msg = reqtext;
                    }else{
                        res.msg = '参数必填';
                    }
                    res.status = false;
                    return false;
                }
            }
        });
        return res;
    }
